
        <div class="x-body">
            <form class="layui-form">
                <div class="layui-form-item">
                    <label for="level-id" class="layui-form-label">
                        id
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="level-id" name="level-id" disabled="" value="<?php echo $data['id'] ?>" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="level-name" class="layui-form-label">
                        <span class="x-red">*</span>等级名
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="level-name" name="level-name" required="" lay-verify="required" autocomplete="off" value="<?php echo $data['dengji'] ?>" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="level-kiss" class="layui-form-label">
                        <span class="x-red">*</span>积分
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="level-kiss" name="level-kiss" required="" value="<?php echo $data['kiss'] ?>" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_repass" class="layui-form-label">
                    </label>
                    <button class="layui-btn" lay-filter="save" lay-submit="">
                        保存
                    </button>
                </div>
            </form>
        </div>

        <script>
            layui.use(['form','layer'], function(){
                $ = layui.jquery;
              var form = layui.form()
              ,layer = layui.layer;
            
              //监听提交
              form.on('submit(save)', function(data){
                //发异步，把数据提交给php
               $.ajax({
               	url: '{:U('admin/user/userleveladd')}',
               	type: 'POST',
               	dataType: 'json',
               	data: data.field,
               })
               .done(function(res) {
               		if (res.error==1) {
                        layer.msg(res.info,{icon:1});
                    }else{
                        layer.alert("修改成功", {icon: 6},function () {
	                    // 获得frame索引
	                    var index = parent.layer.getFrameIndex(window.name);
	                    //关闭当前frame
	                    parent.layer.close(index);
	                    parent.location.reload();
                	});
                  };
               }) 
                return false;
              });
            });
        </script>

    

